package com.lj.graduate.mapper;

import com.lj.graduate.controller.dto.OrderDetailDTO;
import com.lj.graduate.entity.OrderDetail;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lj.graduate.entity.Tickets;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author ljy
 * @since 2023-04-13
 */
public interface OrderDetailMapper extends BaseMapper<OrderDetail> {

    @Select("SELECT commodity_order_id ,commodity.commodity_id,commodity_order_time ,user.user_name ,consumption ,user.address  ,commodity_order_detail.number ,user.tel ,commodity.commodity_name  FROM" +
            "(" +
            "( `commodity_order_detail` Inner JOIN `user` ON ( ( `commodity_order_detail`.`user_id` = `user`.`user_id` ) ) )" +
            "Inner JOIN `commodity` ON ( ( `commodity_order_detail`.`commodity_id` = `commodity`.`commodity_id` ) ) " +
            ") limit #{pageNum}, #{pageSize}")
    List<OrderDetailDTO>  selectPage(Integer pageNum, Integer pageSize);
}
